package com.chinapost.po;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Twdry entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TWDRY", schema = "WDZY")
public class Twdry implements java.io.Serializable {

	// Fields

	private String cbh;
	private Tuser tuserByCcreateuserid;
	private Twdxx twdxx;
	private Tdept tdept;
	private Tuser tuserByCmodifyuserid;
	private String cname;
	private String cyglb;
	private String csex;
	private Timestamp ccreatedate;
	private Timestamp cmodifydate;
	private Set<Tygxc> tygxcs = new HashSet<Tygxc>(0);

	// Constructors

	/** default constructor */
	public Twdry() {
	}

	/** minimal constructor */
	public Twdry(String cbh, Twdxx twdxx, Tdept tdept, String cname) {
		this.cbh = cbh;
		this.twdxx = twdxx;
		this.tdept = tdept;
		this.cname = cname;
	}

	/** full constructor */
	public Twdry(String cbh, Tuser tuserByCcreateuserid, Twdxx twdxx, Tdept tdept, Tuser tuserByCmodifyuserid, String cname, String cyglb, String csex, Timestamp ccreatedate, Timestamp cmodifydate, Set<Tygxc> tygxcs) {
		this.cbh = cbh;
		this.tuserByCcreateuserid = tuserByCcreateuserid;
		this.twdxx = twdxx;
		this.tdept = tdept;
		this.tuserByCmodifyuserid = tuserByCmodifyuserid;
		this.cname = cname;
		this.cyglb = cyglb;
		this.csex = csex;
		this.ccreatedate = ccreatedate;
		this.cmodifydate = cmodifydate;
		this.tygxcs = tygxcs;
	}

	// Property accessors
	@Id
	@Column(name = "CBH", unique = true, nullable = false, length = 10)
	public String getCbh() {
		return this.cbh;
	}

	public void setCbh(String cbh) {
		this.cbh = cbh;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CCREATEUSERID")
	public Tuser getTuserByCcreateuserid() {
		return this.tuserByCcreateuserid;
	}

	public void setTuserByCcreateuserid(Tuser tuserByCcreateuserid) {
		this.tuserByCcreateuserid = tuserByCcreateuserid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CWDID", nullable = false)
	public Twdxx getTwdxx() {
		return this.twdxx;
	}

	public void setTwdxx(Twdxx twdxx) {
		this.twdxx = twdxx;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CDEPTID", nullable = false)
	public Tdept getTdept() {
		return this.tdept;
	}

	public void setTdept(Tdept tdept) {
		this.tdept = tdept;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CMODIFYUSERID")
	public Tuser getTuserByCmodifyuserid() {
		return this.tuserByCmodifyuserid;
	}

	public void setTuserByCmodifyuserid(Tuser tuserByCmodifyuserid) {
		this.tuserByCmodifyuserid = tuserByCmodifyuserid;
	}

	@Column(name = "CNAME", nullable = false, length = 20)
	public String getCname() {
		return this.cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	@Column(name = "CYGLB", length = 20)
	public String getCyglb() {
		return this.cyglb;
	}

	public void setCyglb(String cyglb) {
		this.cyglb = cyglb;
	}

	@Column(name = "CSEX", length = 4)
	public String getCsex() {
		return this.csex;
	}

	public void setCsex(String csex) {
		this.csex = csex;
	}

	@Column(name = "CCREATEDATE", length = 11)
	public Timestamp getCcreatedate() {
		return this.ccreatedate;
	}

	public void setCcreatedate(Timestamp ccreatedate) {
		this.ccreatedate = ccreatedate;
	}

	@Column(name = "CMODIFYDATE", length = 11)
	public Timestamp getCmodifydate() {
		return this.cmodifydate;
	}

	public void setCmodifydate(Timestamp cmodifydate) {
		this.cmodifydate = cmodifydate;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "twdry")
	public Set<Tygxc> getTygxcs() {
		return this.tygxcs;
	}

	public void setTygxcs(Set<Tygxc> tygxcs) {
		this.tygxcs = tygxcs;
	}

}